#include <stdio.h>
#include <stdlib.h>
#include "StudentMain.h"

void DeleteStudent(node* head)
{
	int DelNum;
	printf("\n欢迎来到删除模式!\n");
	printf("\n请输入您想删除学生的学号:>");
	scanf("%d", &DelNum);

	NodeDelete(head, DelNum);	

}

void NodeDelete(node* head, int num)
{
	node* tmp;
	tmp = head;
	while(tmp->next != head)
	{
		tmp = tmp->next;
		if(tmp->data->id == num)
		{
			tmp->prve->next = tmp->next;
			tmp->next->prve = tmp->prve;
			//free(tmp->data);
			free(tmp);
			printf("\n删除成功！\n");
			return;
		}
	}	
}
